(function () {
	
	jQuery('.addBtn').on('click', function () {
		var url = window.rootPath + "/ui/CommercialTenant/GetAccessToken";
		jQuery.ajax({
            type: 'get',
            url: encodeURI(url),
           /* data: JSON.stringify(d),*/
            dataType: 'json',
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
            	jQuery('#accessToken').val(data.access_token);
            }
        });
	});
	
	jQuery('.getBtn').on('click', function () {
		var url = window.rootPath + "/ui/CommercialTenant/GetTicket/"+jQuery('#accessToken').val();
		jQuery.ajax({
            type: 'get',
            url: encodeURI(url),
           /* data: JSON.stringify(d),*/
            dataType: 'json',
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
            	jQuery('#ticket').val(data.access_token);
            }
        });
	});
})(); 